{% extends "projects/base.html" %}


{% block title %}overview - {{block.super}}{% endblock %}


{% block projectcontent %} 


{% if page_obj.object_list %}
{% if not tag %}
<div id="sorting-criteria">
  order by: 
  <a href="/projects/latest/" class="{% active request '^/projects/latest/$' %}">last change</a> &nbsp;  
  <a href="/projects/discussed/" class="{% active request '^/projects/discussed/$' %}">most discussed</a> &nbsp; 
  <a href="/projects/alphabet/" class="{% active request '^/projects/alphabet/$' %}">alphabet</a> &nbsp; 
</div>
{% endif %}
{% endif %}

{% if tag %}
<h1>Tag <em>{{tag.name}}</em></h1>
<h2>Related Tags</h2>
{% if related_tags %}
{% taglist related_tags "project_tag_page" tag %}
{% else %}
There are no tags related to <em>{{tag}}</em>.
{% endif %}


<h2>Projects tagged with <em>{{tag.name}}</em></h2>
{% endif %}

{% for project in page_obj.object_list %}
    <div class="overview-project">
    {{project.get_screenshot.preview}}
      {% tags_for_object project as tag_list %}
      <h2 title="{{project.comment_count}} comment{{project.comment_count|pluralize}}
{% if tag_list %}; tag{{tag_list|pluralize}}: {{tag_list|join_nicer}}{% endif %}">
            <a href="{{project.get_absolute_url}}">{{project.name}}</a></h2>
      <div class="project-summary">
          {{ project.raw_summary|safe}}
      </div>
	  <br />
    </div>
	<hr />
{% endfor %}

{% if page_obj %}

{% paginator 5 %}

{% else %}
<h1> Tags </h1>
<h2> used at least 3 times</h2>
{% tag_cloud_for_model projects.Project as project_tags with steps=20 min_count=3 distribution=log %}
{% for tag in project_tags %}
<a href="{% url project_tag_page tag.name %}" style="font-size:{{tag.font_size|add:10}}px;" 
   title="used {{tag.count}} times" class="tag project-tag">{{tag.name}}</a>
{% endfor %}
{% endif %}

{% endblock %} 
